﻿<Page x:Class="Thirteen23.TED.Views.TalkPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Loaded="Page_Loaded" Unloaded="Page_Unloaded"
    mc:Ignorable="d"
    xmlns:local="clr-namespace:Thirteen23.TED.Views"
    d:DesignWidth="1366" d:DesignHeight="768">

    <!--Common resources for default dark theme applications-->
    <Page.Resources>
        <SolidColorBrush x:Key="PageBackgroundBrush" Color="#FF1A1A1A"/>
        <SolidColorBrush x:Key="PageForegroundBrush" Color="White"/>
        <SolidColorBrush x:Key="HighlightBrush" Color="#FF26A0DA"/>

    </Page.Resources>

    <Grid x:Name="LayoutRoot" Background="{StaticResource PageBackgroundBrush}"
          PointerReleased="OnPointerReleased">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="OrientationStates">
                <VisualState x:Name="Full"/>
                <VisualState x:Name="Fill"/>
                <VisualState x:Name="Portrait"/>
                <VisualState x:Name="Snapped"/>
            </VisualStateGroup>
            <VisualStateGroup x:Name="LoadingStates">
                <VisualState x:Name="Loading">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LoaderPanel" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="NotLoading">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="LoaderPanel" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
            <VisualStateGroup x:Name="ControlVisibilityStates">
                <VisualState x:Name="ControlsShowing">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="TopControls" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ProgressSlider" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="ControlsHidden">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="TopControls" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="ProgressSlider" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Grid.RowDefinitions>
            <RowDefinition Height="80"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <MediaElement x:Name="MediaElement"
                      Grid.Row="0"
                      Grid.RowSpan="2"
                      Stretch="Uniform"
                      Visibility="Collapsed" />

        <StackPanel x:Name="PauseIndicator"
                    Orientation="Horizontal"
                 HorizontalAlignment="Center"
                 VerticalAlignment="Center"
                 Visibility="Collapsed"
                 Grid.Row="1">

            <Viewbox Stretch="Uniform" 
                     Width="70"
                     Height="70">
                <Viewbox.RenderTransform>
                    <TranslateTransform X="70" />
                </Viewbox.RenderTransform>
                <Path Fill="#FFFFFF"
                      Data="M7,0 L14,8 L0,8 z">
                    <Path.RenderTransform>
                        <RotateTransform Angle="90" />
                    </Path.RenderTransform>
                </Path>
            </Viewbox>

        </StackPanel>


        <Grid Background="#80000000"
              x:Name="TopControls">

            <Button Click="BackButtonClicked" 
                    Content="CLOSE" 
                    Height="60"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center"
                    Margin="0,6,6,0" />

            <StackPanel HorizontalAlignment="Center" 
                        VerticalAlignment="Center">
                <TextBlock x:Name="TitleText" 
                           HorizontalAlignment="Center"
                           FontFamily="Segoe UI Light"
                           FontWeight="Bold"
                           FontSize="30"/>

                <TextBlock x:Name="AuthorText" 
                           FontStyle="Italic"
                           HorizontalAlignment="Center"
                           FontSize="17"/>
            </StackPanel>
        </Grid>

        <Slider x:Name="ProgressSlider"
              Grid.Row="1"
              IsThumbToolTipEnabled="False"
              VerticalAlignment="Bottom"/>


        <StackPanel x:Name="LoaderPanel"
                  Grid.Row="1"
                  VerticalAlignment="Center">
            <TextBlock HorizontalAlignment="Center"
                       Text="Loading..."
                       FontSize="14"
                       Foreground="Gray" />

            <ProgressBar x:Name="Loader"
                         Margin="0,10,0,0"
                         Foreground="Gray"
                         IsIndeterminate="True" />
        </StackPanel>


    </Grid>
</Page>